﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using BaseData.Common;
using BaseData.UI;
using TaxData.SysConfig;
using TaxEntity.SysConfig;
using TaxEntity.User;

namespace TaxBiz.SysConfig
{
    /// <summary>
    /// 乡镇逻辑层
    /// </summary>
    public class XiangzhenBiz
    {
        private XiangzhenData xzd = new XiangzhenData();

        /// <summary>
        /// 获取乡镇信息实体
        /// </summary>
        public XiangzhenEntity GetEntityById(int ID)
        {
            XiangzhenEntity model = xzd.GetEntityById(ID);
            return model;
        }

        /// <summary>
        /// 删除乡镇
        /// </summary>
        public bool Delete(int ID, UserEntity optUser)
        {
            bool isSucc = xzd.Delete(ID);
            return isSucc;
        }

        /// <summary>
        /// 获取乡镇列表
        /// </summary>
        public DataTable GetList(string strWhere, int pageSize, int page, ref int allCount)
        {
            DataTable dt = xzd.GetList(strWhere, pageSize, page, ref allCount);
            return dt;
        }

        /// <summary>
        /// 获取乡镇列表
        /// </summary>
        public DataTable GetList()
        {
            DataTable dt = xzd.GetList();
            return dt;
        }

        /// <summary>
        /// 增加乡镇
        /// </summary>
        /// <param name="model">乡镇信息实体</param>
        /// <param name="optUser">操作人</param>
        /// <returns>成功乡镇编号,失败返回0</returns>
        public int Add(XiangzhenEntity model, UserEntity optUser)
        {
            int id = xzd.Add(model);
            return id;
        }

        /// <summary>
        /// 修改乡镇信息
        /// </summary>
        /// <param name="model">修改乡镇</param>
        /// <param name="optUser">操作人</param>
        /// <returns>操作结果</returns>
        public bool Update(XiangzhenEntity model, UserEntity optUser)
        {
            bool isSucc = xzd.Update(model);
            return isSucc;
        }
    }
}